package cn.wh.executor;

import cn.wh.mapping.BoundSql;
import cn.wh.mapping.MappedStatement;
import cn.wh.session.ResultHandler;
import cn.wh.transaction.Transaction;

import java.sql.SQLException;
import java.util.List;

/**
 * @Author: wh
 * @CreateTime: 2023-01-17  09:13
 * @Description: 执行器
 * @Version: 1.0
 */
public interface Executor {

    ResultHandler NO_RESULT_HANDLER = null;

    <E>List<E> query(MappedStatement ms, Object parameter, ResultHandler resultHandler, BoundSql boundSql);

    Transaction getTransaction();

    void commit(boolean required)throws SQLException;

    void rollback(boolean required) throws SQLException;

    void close(boolean forceRollback);

}
